/**
 * Copyright (C)  2011  chen wei hua.
 * Permission is granted to copy, distribute and/or modify this document
 * under the terms of the GNU Free Documentation License, Version 2.0
 * or any later version published by the Free Software Foundation;
 * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 * A copy of the license is included in the section entitled "GNU Free Documentation License".
 */
package com.javaeye.common.service;

import com.javaeye.delivery.dao.OrderDAO;
import com.javaeye.delivery.service.IOrderService;

public class WelcomeService implements IWelcomeService {
	
	public OrderDAO dao;

	public void setDao(OrderDAO dao) {
		this.dao = dao;
	}

	@Override
	public int[] getWelcomeData() {
		int[] retVal= new int[4];
		retVal[0] = (int)dao.getOrderByOrderStatus(IOrderService.ORDER_STATES_CREATED);
		retVal[1] = (int)dao.getOrderByOrderStatus(IOrderService.ORDER_STATES_PLAN);
		retVal[2] = (int)dao.getOrderByOrderStatus(IOrderService.ORDER_STATES_IN_STORE)
					+ (int)dao.getOrderByOrderStatus(IOrderService.ORDER_STATES_CHECKED);
		retVal[3] = (int)dao.getOrderByOrderStatus(IOrderService.ORDER_STATES_CREATED_DELIVERY_ORDER);
		return retVal;
	}

}
